Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure webpubsub #59

Closed
wants to merge 5 commits into from
Closed

Azure webpubsub #59

wants to merge 5 commits into from

Conversation

byrond
Copy link

@byrond byrond commented Nov 15, 2023

This likely won't be the final implementation but represents most of the changes that need to be made to make y-webrtc compatible with Azure Web PubSub as a signaling server. The final solution will be to make y-webrtc extensible for swapping out signaling server code. Currently, y-webrtc makes assumptions about the message format and structure, which makes it difficult to plug in a different signaling server.

src/y-webrtc.js Outdated
const log = logging.createModuleLogger('y-webrtc')
import { WebPubSubClient } from "@azure/web-pubsub-client";

const log = logging.createModuleLogger('y-webrtc-azure-webpubsub')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this code from a local copy of the module that was renamed to y-webrtc-azure-webpubsub

}
}

export class SignalingConn extends ws.WebsocketClient {
export class SignalingConn extends Observable {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't actually need to extend Observable since the client subscribes to events, not this class.

@byrond
Copy link
Author

byrond commented Nov 15, 2023

I think we can create some SignalingConn methods to abstract the subscribe and publish calls in the global functions. One thing I'm not sure about is when we extend SignalingConn, we don't actually want to use any of it but would be required to call super() in our derived class. We could create a base class, but the existing SignalingConn needs to extend ws in lib0/websocket.

@byrond
Copy link
Author

byrond commented Nov 17, 2023

Closing this, which was opened on the wrong repo. We will eventually separate this work out into a PR for y-webrtc that makes the signaling connection extensible/swappable and a separate library that adds support for using Azure Web PubSub as a signaling server.

Sorry for the confusion. GitHub insists on making the original repo the base for PRs instead of the fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant